/* CSS for Number Line Estimation Game - Mobile-first responsive design */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    user-select: none;
    overflow: hidden;
}

/* Main game container with responsive height */
.game-container {
    width: 100%;
    height: 450px; /* Default iframe height */
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Responsive height for full browser tab */
@media (min-height: 600px) {
    .game-container {
        height: 90vh;
        padding: 20px;
    }
}

/* Tooltip for header information */
.tooltip {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
    max-width: 90%;
    text-align: center;
}

.game-container:hover .tooltip {
    opacity: 1;
}

/* Score panel */
.score-panel {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    background: white;
    padding: 8px 15px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.score-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.score-label {
    font-weight: bold;
    color: #2196f3;
    font-size: 14px;
}

.score-value {
    background: #4caf50;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
    font-size: 14px;
}

/* Number display area */
.number-display {
    text-align: center;
    margin-bottom: 15px;
}

.instruction-text {
    font-size: 16px;
    color: #333;
    margin-bottom: 10px;
    font-weight: 600;
}

/* Draggable ball styling */
.draggable-ball {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    transition: all 0.3s ease;
    border: 4px solid white;
    position: relative;
    z-index: 100;
}

.draggable-ball:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
}

.draggable-ball:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.ball-number {
    font-size: 24px;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Number line container */
.number-line-container {
    position: relative;
    margin: 20px 0;
    flex-grow: 1;
    display: flex;
    align-items: center;
    min-height: 120px;
}

/* Main number line - Simplified with clean appearance */
.number-line {
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, #4caf50 0%, #2196f3 50%, #ff9800 100%);
    border-radius: 4px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    margin: 40px 0;
}

/* Drop indicator */
.drop-indicator {
    position: absolute;
    width: 3px;
    height: 60px;
    background: #ff4444;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 50;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

.drop-indicator.show {
    opacity: 1;
}

/* Tick marks - Only for major markers (0, 50, 100) */
.tick {
    position: absolute;
    top: 50%;
    transform: translateX(-50%);
}

.tick-mark {
    width: 2px;
    background: #333;
    margin: 0 auto;
}

.tick-label {
    text-align: center;
    font-weight: bold;
    margin-top: 5px;
    color: #333;
}

/* Major ticks (0, 50, 100) - Enhanced visibility for simplified number line */
.tick.major .tick-mark {
    height: 20px;
    width: 3px;
    background: #333;
    transform: translateY(-50%);
}

.tick.major .tick-label {
    font-size: 16px;
    margin-top: 15px;
}

/* Removed styles for minor and subtle ticks as they are no longer needed */

/* Feedback panel */
.feedback-panel {
    text-align: center;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.feedback-message {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.feedback-emoji {
    font-size: 32px;
    animation: bounce 0.6s ease-in-out;
}

@keyframes bounce {
    0%, 20%, 60%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    80% { transform: translateY(-5px); }
}

/* Control buttons */
.control-panel {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.game-button {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(33, 150, 243, 0.3);
    min-height: 44px; /* Touch-friendly minimum height */
    white-space: nowrap;
}

.game-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.4);
}

.game-button:active {
    transform: translateY(0);
}

#tryAgainBtn {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    box-shadow: 0 3px 10px rgba(255, 152, 0, 0.3);
}

#showAnswerBtn {
    background: linear-gradient(135deg, #9c27b0 0%, #7b1fa2 100%);
    box-shadow: 0 3px 10px rgba(156, 39, 176, 0.3);
}

#nextBtn {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    box-shadow: 0 3px 10px rgba(76, 175, 80, 0.3);
}

#audioBtn {
    background: linear-gradient(135deg, #607d8b 0%, #455a64 100%);
    box-shadow: 0 3px 10px rgba(96, 125, 139, 0.3);
}

/* Correct position indicator */
.correct-indicator {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #4caf50;
    border-radius: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 75;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.8);
}

.correct-indicator.show {
    opacity: 1;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.5); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* Dragging states */
.dragging {
    opacity: 0.8;
    transform: scale(1.1);
    z-index: 1000;
    pointer-events: none;
}

.number-line-container.drag-over {
    background: rgba(76, 175, 80, 0.1);
    border-radius: 10px;
}

/* Success and error states */
.success {
    color: #4caf50;
}

.error {
    color: #f44336;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .game-container {
        padding: 8px;
    }
    
    .draggable-ball {
        width: 70px;
        height: 70px;
    }
    
    .ball-number {
        font-size: 20px;
    }
    
    .control-panel {
        gap: 6px;
    }
    
    .game-button {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .instruction-text {
        font-size: 14px;
    }
}